package com.dsg.service.account.impl;

import com.dsg.common.util.SingletonLoginUtils;
import com.dsg.dao.account.DsgAccountSettingMapper;
import com.dsg.entity.account.DsgAccountSetting;
import com.dsg.service.DsgServiceImpl;
import com.dsg.service.account.IDsgAccountSettingService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 天鑽收款銀行帳戶 服务实现类
 * </p>
 *
 * @author system
 * @since 2020-07-28
 */
@Service
public class DsgAccountSettingServiceImpl extends DsgServiceImpl<DsgAccountSettingMapper, DsgAccountSetting> implements IDsgAccountSettingService {

    @Override
    public List<Map<String, String>> selectBankCodeList() {
        DsgAccountSetting dsgAccountSetting = new DsgAccountSetting();
        dsgAccountSetting.setEntCode(SingletonLoginUtils.getSystemEntCode());
        List<DsgAccountSetting> dsgAccountSettingList = baseMapper.selectBankCodeList(dsgAccountSetting);
        List<Map<String, String>> mapList = new ArrayList<>();
        dsgAccountSettingList.forEach(I -> {
            Map<String, String> map = new HashMap<>();
            map.put("paraKey", I.getAccountNo());
            map.put("paraValue", I.getAccountName() + " " + I.getDefMethodName());
            mapList.add(map);
        });
        return mapList;
    }
}
